/*
 * @Description:
 * @Version: 1.0
 * @Autor: gaoluo
 * @Date: 2022-05-05 14:42:29
 * @LastEditors: gaoluo
 * @LastEditTime: 2022-05-23 15:23:54
 * @FilePath: /vue3.0-vite-ts-xiaotuxian/src/stores/index.ts
 */
import { defineStore } from "pinia";

export const useStore = defineStore("main", {
  state: () => {
    return {
      token: "",
    };
  },
  getters: {},
  actions: {
    getToken(token: string) {
      this.token = token;
    },
  },
  persist: {
    enabled: true,
    strategies: [
      {
        storage: localStorage,
      },
    ],
  },
});
